package com.fg.ihr.repository;
import com.fg.ihr.domain.Department;
import com.fg.ihr.domain.Position;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import javax.persistence.criteria.CriteriaBuilder;
import java.util.List;


@Repository
public interface PositionRepository extends JpaRepository<Position, Integer>,JpaSpecificationExecutor<Position> {

    Position findAllByName(String name);

    @Query(nativeQuery = true,value="select * from position p where p.id in :ids")
    List<Position> findAllByIds(@Param("ids") List<Integer> ids);

}
